package com.hong.controller;
import com.github.pagehelper.PageInfo;
import com.hong.domain.Student;
import com.hong.dto.QueryStudentPageDTO;
import com.hong.dto.QueryStudentResultVO;
import com.hong.service.StudentService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import org.springframework.beans.factory.annotation.Autowired;

/**
* (test.students)表控制层
*
* @author xxxxx
*/
@RestController
@RequestMapping("/student")
@Api(value = "学生",tags = {"学生"})
public class StudentController {
/**
* 服务对象
*/
    @Autowired
    private StudentService studentService;

    /**
    * 通过主键查询单条数据
    *
    * @param id 主键
    * @return 单条数据
    */
    @GetMapping("selectOne")
    public Student selectOne(Integer id) {
    return studentService.selectByPrimaryKey(id);
    }

    @ApiOperation(value = "分页")
    @GetMapping("page")
    public PageInfo<QueryStudentResultVO> getPage(QueryStudentPageDTO param){
        return studentService.getPage(param);
    }

}
